﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using Wpf.Ui.Controls;

namespace ClientAppraise.Controls;

public class ZxQueryCard  : VirtualizingItemsControl
{

    public static readonly RoutedEvent SubmitEvent;
    public static readonly RoutedEvent ResetEvent;
    public static readonly RoutedEvent ExpandOrColseEvent;


    static ZxQueryCard()
    {
        SubmitEvent = EventManager.RegisterRoutedEvent(nameof(Submit), RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(ZxQueryCard));
        ResetEvent = EventManager.RegisterRoutedEvent(nameof(Reset), RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(ZxQueryCard));
        ExpandOrColseEvent = EventManager.RegisterRoutedEvent(nameof(ExpandOrColse), RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(ZxQueryCard));
    }


    public event RoutedEventHandler Submit
    {
        add => AddHandler(SubmitEvent, value);
        remove => RemoveHandler(SubmitEvent, value);
    }
    private void Submit_Click(object sender, RoutedEventArgs e)
    {
        RaiseEvent(new RoutedEventArgs(SubmitEvent, this));
    }


    public event RoutedEventHandler Reset
    {
        add => AddHandler(SubmitEvent, value);
        remove => RemoveHandler(SubmitEvent, value);
    }
    private void Reset_Click(object sender, RoutedEventArgs e)
    {
        RaiseEvent(new RoutedEventArgs(ResetEvent, this));
    }


    public event RoutedEventHandler ExpandOrColse
    {
        add => AddHandler(SubmitEvent, value);
        remove => RemoveHandler(SubmitEvent, value);
    }
    private void ExpandOrColseEvent_Click(object sender, RoutedEventArgs e)
    {
        this.MinWidth = 0;
        this.MaxWidth = 0;

        RaiseEvent(new RoutedEventArgs(ExpandOrColseEvent, this));
    }




}
